<?php
/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2018/1/26
 * Time: 下午9:48
 */

echo mb_check_encoding('你好','utf-8').PHP_EOL;
echo mb_check_encoding('你好','gbk').PHP_EOL;
echo mb_check_encoding('hello','gbk').PHP_EOL;

$encoding = mb_internal_encoding();
//var_dump($encoding);
if (!is_array($encoding))
    echo $encoding.PHP_EOL;
mb_internal_encoding("gb2312");
$encoding = mb_internal_encoding();
if(!is_array($encoding))
    echo $encoding.PHP_EOL;